/*
 通过mutation间接更新state的多个方法的对象
 */
import {reqMenu} from '../api/index'
import {GET_MENU_LIST} from './mutation-types'

export default {
  // 异步获取菜单列表
  async getMenuList({commit, state}) {
    // state是接收的参数
    const result = await reqMenu();
    commit(GET_MENU_LIST, {menuList: result.data})
  },
}
